package com.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 * 留言板 表定义层。
 *
 * @author admin
 * @since 2024-06-21
 */
public class LiuyanTableDef extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 留言板
     */
    public static final LiuyanTableDef LIUYAN = new LiuyanTableDef();

    
    public final QueryColumn ID = new QueryColumn(this, "id");

    
    public final QueryColumn NAME = new QueryColumn(this, "name");

    
    public final QueryColumn EMAIL = new QueryColumn(this, "email");

    
    public final QueryColumn PHONE = new QueryColumn(this, "phone");

    /**
     * 留言
     */
    public final QueryColumn MESSAGE = new QueryColumn(this, "message");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, PHONE, EMAIL, NAME, MESSAGE};

    public LiuyanTableDef() {
        super("", "liuyan");
    }

    private LiuyanTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public LiuyanTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new LiuyanTableDef("", "liuyan", alias));
    }

}
